/**
 * Copyright (c) 2018 软唐 All rights reserved.
 * <p>
 * https://www.softtown.cn
 * <p>
 * 版权所有，侵权必究！
 */

package com.softtown.modules.sys.dao;

import com.softtown.common.dao.BaseDao;
import com.softtown.modules.sys.entity.SysUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 系统用户
 *
 * @author Ding Ya Yong
 */
@Mapper
@Component(value = "SysUserDao")
public interface SysUserDao extends BaseDao<SysUserEntity> {


    SysUserEntity getByUsername(String username);

    SysUserEntity getByMobile(String mobile);

    int updatePassword(@Param("id") Long id, @Param("newPassword") String newPassword);

    /**
     * 根据部门ID，查询用户数
     */
    int getCountByDeptId(Long deptId);

    /**
     * 根据ID，查询用户
     */
    SysUserEntity getByUserId(Long id);

    /**
     * 根据手机，查询用户
     */
    SysUserEntity getEntityByMobile(String mobile);

    /**
     * 根据邮箱，查询用户
     */
    SysUserEntity getEntityByEmail(String email);

    /**
     * @param @param [sysUserEntity]
     * @return @return void
     * @throws
     * @Title: updateMobileNumber
     * @Description: 用户解绑手机号接口
     * @author fuming
     * @date 2019/7/10 22:06
     */
    void updateMobileNumber(SysUserEntity sysUserEntity);

    /**
     * @param @param [sysUserEntity]
     * @return @return void
     * @throws
     * @Title: updateEmail
     * @Description: 用户解绑邮箱接口
     * @author fuming
     * @date 2019/7/12 19:33
     */
    void updateEmail(SysUserEntity sysUserEntity);

    /**
     * @param @param [sysUserEntity]
     * @return @return int
     * @throws
     * @Title: updatePersonalInfo
     * @Description: 用户修改个人信息接口
     * @author fuming
     * @date 2019/7/12 19:33
     */
    int updatePersonalInfo(SysUserEntity sysUserEntity);

    void updateUserInfo(SysUserEntity sysUserEntity);

    /**
     * @param @param []
     * @return @return java.util.List<com.softtown.modules.sys.entity.SysUserEntity>
     * @throws
     * @Title: getSysUserInfos
     * @Description: 查询所有用户信息接口
     * @author fuming
     * @date 2019/7/31 11:14
     */
    List<SysUserEntity> getSysUserInfos();

    /**
     * 查询所有系统用户的邮箱账号
     *
     * @param
     * @return java.util.List<java.lang.String>
     * @Author fuming
     * @Date 2020/2/6 11:29
     */
    List<String> selectSysUserEmailList();
}